<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		*{
			margin: 0;
			padding: 0;
			list-style: none;
		}
		main{
			width: 310px;
			height: 512px;
			margin: 50px auto;
			border:2px solid #006699;
			text-align: center;
		}
		main h3{
			font-size: 22px;
			color:#888888;
			line-height: 40px;
		}
		main .p1{
			font-size: 14px;
			color:#888888;
			margin-bottom: 30px;
		}
		main form input{
			margin-bottom:18px;
			width: 259px;
			height: 44px;
			padding-left:10px;
		}
		main form p input{
			width: 122px;
			height: 47px;
			border:none;
			color:#fff;
		}
		.s1{
			background: #ff1313;
		}
		.s2{
			background: #4ebf2d;
		}
	</style>
</head>
<body>
	<main>
		<h3>用户注册</h3>
		<p class="p1">对新增元素，新增属性的测试案例</p>
	<form action="#" method="post">
		<input type="text" value="" placeholder="请输入用户名"><br>
		<input type="password" value="" placeholder="请输入您的密码"><br>
		<input type="password" value="" placeholder="请输入您的确认密码"><br>
		<input type="email" name="" value="" placeholder="请输入你常用的邮箱地址"><br>
		<input type="date" value="" placeholder="年/月/日">
		<p><input type="button" value="验证提交" class="s1">
		<input type="button" value="无需验证提交" class="s2">
		</p>
		<p>已有账号<a href="#">登录</a></p>	
	</form>
	</main>
</body>
<script src="jquery-3.2.1.min.js"></script>
<script>
	function mai(){
	localStorage.clear();
	console.log(localStorage.getItem);
	
}
 $('input[type=button]').on('click', function(){
 	var dataAll = localStorage.getItem('list');
    dataAll = dataAll ? JSON.parse(dataAll) : [];
    mai()
         // var name1 = $('input').eq(0).val();
         //  var name2 = $('input').eq(1).val();
       
         // localStorage.setItem(name,name1)
         // localStorage.setItem(name2,name2)
         // // localStorage.setItem(name,name1)
         // // localStorage.setItem(name,name1)
         // // localStorage.setItem(name,name1)
         // console.log(localStorage.getItem(name))
         // console.log(localStorage.getItem(name2))


var obj = {
        name: $('input').eq(0).val(),
        password: $('input').eq(1).val(),
        password1: $('input').eq(2).val(),
        email: $('input').eq(3).val(),
         date:$('input').eq(4).val()
      }
   
  // 数据保存
      dataAll.push(obj);
      localStorage.setItem('list', JSON.stringify(dataAll));
	console.log(dataAll)
 })

</script>
</html>